<template>
  <div class="page-body">
    <div class="page-head">
      <div @click="utils.toBack()" class="iconfont icon-fanhui"></div>
    </div>

    <div class="page-content">
      <div class="search-box">
        <div class="flex items-center">
          <div style="width: 300rpx">
            <uni-datetime-picker v-model="queryParams.date" type="daterange" />
          </div>

          <div class="bts flex items-center">
            <div class="search-bt search-bt-primary">查询</div>
            <div @click="resetQueryParams" class="search-bt">重置</div>
            <!-- <div class="search-bt"></div>
              <div class="search-bt">重置</div> -->
          </div>
        </div>

        <div  class="initiate-bt">新增缴款单</div>
      </div>

      <div class="m-t-20">
        <w-table :columns="columns" :data="tableData">
          <template #date="scoped">
            <div>{{ scoped.row }}</div>
          </template>
          <template #operate>
            <div class="flex justify-center">
              <div class="color-primary p-x-5">查看</div>
            </div>
          </template>
        </w-table>
      </div>
    </div>
  </div>
</template>
<script setup>
import { ref } from "vue";
import utils from "@/utils/index";
const columns = ref([
  { title: "交易时间", key: "date" ,width: 2},
  { title: "订单编号", key: "id" },
  { title: "交易类型", key: "id" },
  { title: "金额(元)", key: "id" },
  { title: "会员手机号", key: "id" },
  { title: "收银员", key: "id" },
  { title: "操作", key: "operate" },
]);

const tableData = ref([
  {
    id: "123",
  },
  {
    id: "123",
  },
  {
    id: "123",
  },
  {
    id: "123",
  },
  {
    id: "123",
  },
  {
    id: "123",
  },
  {
    id: "123",
  },
  {
    id: "123",
  },
  {
    id: "123",
  },
  {
    id: "123",
  },
]);

const defaultQueryParams = () => ({
  date: undefined,
  startTime: new Date("2023-01-01"),
  endTime: new Date("2023-01-31"),
  type: undefined,
  phone: undefined,
  orderNo: undefined,
});

const queryParams = ref(defaultQueryParams());

function resetQueryParams() {
  queryParams.value = defaultQueryParams();
}
</script>
<style lang="scss" scoped>
.page-body {
  background: #f0f2f5;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.page-head {
  display: flex;
  align-items: center;
  height: 50rpx;
  background: rgba(27, 122, 254, 1);
  box-shadow: 0px 0px 13.33px rgba(0, 0, 0, 0.1);
  color: $uni-text-color-inverse;

  .icon-fanhui {
    font-size: 24rpx;
    font-weight: 700;
    width: 60rpx;
    height: 50rpx;
    line-height: 50rpx;
    text-align: center;
    background: rgba(13, 84, 184, 1);
  }
}

.page-content {
  flex: 1;
  height: 0;
  margin: 10rpx;
  background: $uni-bg-color;
  border-radius: 8rpx;
  padding: 14rpx 20rpx;

  .search-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    .search-bt {
      margin-left: 10rpx;
      width: 80rpx;
      height: 40rpx;
      line-height: 40rpx;
      text-align: center;
      border-radius: 4rpx;
      border: 1rpx solid $uni-border-color-1;
    }
    .search-bt-primary {
      color: $uni-color-primary;
      border: 1rpx solid $uni-color-primary;
    }

    .initiate-bt {
      width: 100rpx;
      height: 40rpx;
      border-radius: 8rpx;
      background: $uni-color-primary;
      line-height: 40rpx;
      text-align: center;
      color: $uni-text-color-inverse;
    }
  }
}
</style>
